<?php 
class ComAction extends Action{
	public function _initialize(){		
	//p($_SESSION);die;
	// $_SESSION['username'];
	// 	if(!isset($_SESSION['username'])){   
	// 	  //var_dump(session('username'));
	// 		 $this->redirect("Admin/Login/Index");
	// 	}
      if(!isset($_SESSION[C('USER_AUTH_KEY')])){   
		  //var_dump(session('username'));
			 $this->redirect("Admin/Login/Index");
		}
	
		$notAUTH=in_array(MODULE_NAME,explode(',',C('NOT_AUTH_MODULE')))||in_array(ACTION_NAME,explode(',',C('NOT_AUTH_ACTION')));
		if(C('USER_AUTH_ON')&& !$notAUTH){
		  import('ORG.Util.RBAC');
		  //var_dump(RBAC::AccessDecision(GROUP_NAME));
		  RBAC::AccessDecision(GROUP_NAME)||$this->error('没有权限');//项目分组AccessDecision要填上GROUP_NAME，单入口不用填
		}
		

	}

}
?>